Skip to content

libretro: add Wiimote IR passthrough - #471

Merged
cscd98 merged 1 commit into
libretro:masterfrom
XenuIsWatching:feature/ir-passthrough-cher
Aug 27, 2026
Merged

libretro: add Wiimote IR passthrough#471
cscd98 merged 1 commit into
libretro:masterfrom
XenuIsWatching:feature/ir-passthrough-cher

Conversation

@XenuIsWatching

Copy link
Copy Markdown

Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote camera's view of the sensor bar directly instead of having the core synthesise it from a cursor position.

The cursor path cannot be made exact, and it is worth saying why. It parks a notional remote two metres from the bar and rotates it by Total Yaw / Total Pitch, a scale with no physical derivation, then CameraLogic projects the LEDs through that. Where the game finally draws its hand therefore depends on a constant fitted per game, which is what Dolphin's own "defaults chosen to reach screen edges in most games" is admitting. It also cannot express roll or distance at all: two angles have nowhere to put them.

A frontend that knows the real geometry, a VR room, a tracked light gun , can compute the two dots outright and get all of that for free, which is what BuildDesiredWiimoteState already supports and nothing exposed.

Four pieces:

  • The option itself, off by default, under Wiimote IR.

  • The Pointer device now registers all four touch indices rather than only the first. libretro's pointer is multi-touch already, so the four IR objects ride on indices 0-3 instead of needing a new device type. Index 0 keeps the names it had, so the existing mouse-mode IR binding is untouched.

  • IRPassthrough is bound and enabled when the option is on: object N takes Pointer:XN+ / Pointer:YN+ across the camera's 0..1 field (so a frontend sends the positive half of the pointer range), with PressedN as presence and a small constant size, games read size to reject noise, and there is no spare axis to carry it. Bindings are CLEARED when the option is off, because AreInputsBound() is half of what selects this path and a stale binding would keep the cursor route switched off after it was turned back on.

  • irPassthrough is raised at controller setup as well as on an option change, so the setting applies on a cold boot. The IR offset, yaw and pitch settings are gated on IsUpdated alone, which means their declared defaults never reach the emulated remote until something moves them, a trap this option should not inherit.

@XenuIsWatching

Copy link
Copy Markdown
Author

essentially just allows me to then tilt/twist the pointer

@cscd98

cscd98 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Thank you for this. Can you reduce the length of the comments, they are too much and look AI generated to me.

Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote
camera's view of the sensor bar directly instead of having the core
synthesise it from a cursor position.

The cursor path parks a notional remote two metres from the bar and
rotates it by Total Yaw/Total Pitch, a scale with no physical
derivation, so where the game draws its hand depends on a constant
fitted per game. It also cannot express roll or distance. A frontend
that knows the real geometry (a VR room, a tracked light gun) can
compute the two dots outright, which BuildDesiredWiimoteState already
supports and nothing exposed.

  * The option itself, off by default, under Wiimote IR.

  * The Pointer device registers all four touch indices instead of only
    the first, so the four IR objects ride on indices 0-3. Index 0 keeps
    its old names, leaving the mouse-mode IR binding untouched.

  * IRPassthrough is bound and enabled when the option is on: object N
    takes Pointer:XN+/YN+ over the camera's 0..1 field, PressedN as
    presence, and a small constant size. Bindings are cleared when off,
    since AreInputsBound() is half of what selects this path.

  * irPassthrough is raised at controller setup as well as on an option
    change, so the setting applies on a cold boot.
@XenuIsWatching
XenuIsWatching force-pushed the feature/ir-passthrough-cher branch from 4319298 to b0cfde9 Compare August 26, 2026 23:33
@XenuIsWatching

Copy link
Copy Markdown
Author

Thank you for this. Can you reduce the length of the comments, they are too much and look AI generated to me.

done

@cscd98
cscd98 merged commit 41ce890 into libretro:master Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants